<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="probiz" tagdir="/WEB-INF/tags/probiz"%>
<%@ taglib prefix="product" tagdir="/WEB-INF/tags/catalog"%>
<%@ taglib prefix="content" tagdir="/WEB-INF/tags/content"%>
<%@ taglib prefix="sales" tagdir="/WEB-INF/tags/sales"%>
<html>
	<meta name="keywords" content="${(not empty category.keywords)?category.keywords:category.categoryName}" />
	<meta name="description" content="${(not empty category.metaDescription)?category.metaDescription:category.categoryDescription}" />
	<head>
		<title><fmt:message key="product.search"/></title>
	</head>
	<body>
		<%---------------------------------start:搜索条件信息 -------------------------%>
		<%@include file="include/searchProductResultMessage.jspf" %>
		<%---------------------------------end:  搜索条件信息 -------------------------%>
		
		<c:choose>
			<c:when test="${sc.totalCount != 0}">		
				<form id="searchProductListForm" name="searchProductListForm"	method="get">
					
					<%---------------------------------start:快速搜索 -------------------------%>
					<%@include file="include/productListQuickSearch.jspf" %>
					<%---------------------------------end: 快速搜索 -------------------------%>
					
					<div class="page_top clearfix">
						<%@include file="include/productListShowStyle.jspf" %>
						<%@ include file="include/productSort.jspf"%>
						<paging:linkPagingTop/>
					</div>
					<%---------------------------------start:商品列表 -------------------------%>
					<div class="shop_window">
						<div class="content clearfix">
							<ul id="listShowStyleBody" class="${(listShowStyle==2)?'row':'grid'}">
								<c:forEach items="${productList}" var="product">
									<%@ include file="include/productItem.jspf"%>
								</c:forEach>
									
							</ul>
						</div>
					</div>	
					<%---------------------------------end:  商品列表 -------------------------%>
					<div class="page_bottom clearfix">
						<paging:linkPagingBottom/>
					</div>
					
				</form>
			</c:when>
			<c:otherwise>
				<div class="msg">
					<h3><fmt:message key="productList.noSearchResult.msg.title"/></h3>
					<div class="recommend_info">
						<dl>
							<dt><fmt:message key="productList.noSearchResult.msg.advice"/>：</dt>
							<dd><fmt:message key="productList.noSearchResult.msg.advice1"/></dd>
							<dd><fmt:message key="productList.noSearchResult.msg.advice2"/></dd>
						</dl>
					</div>
				</div>
				
				<%---------------------------------start:猜你喜欢 -------------------------%>
				<%--sourceIds设置为null,完全用随机数补足 --%> 
				<sales:recommendedProductList recommendedTypeName="also_buy" sourceKind="1" maxResults="10" sourceIds=""
					returnProductListName="alsoBuyProductList" returnRecommendedTypeName="alsoBuyType" isNeedRand="true">
					<%@ include file="display/productRecommendedWhenSearchNotFound.jspf"%>
				</sales:recommendedProductList>			
				<%---------------------------------end:  猜你喜欢 -------------------------%>
			</c:otherwise>
		</c:choose>	
		
			
		<c:set var="probizJs_productList" value="true" scope="request"/>	
		<script type="text/javascript">
		$j(document).ready(function () {
			<c:if test="${sc.totalCount != 0}">	
				//stat:高亮搜索结果
				if("${productSearchCriteria.keywords}".trim() != ""){
					 var searchValues = "${productSearchCriteria.keywords}".trim().replace(/\s+/,"|").split("|");
					 highlight($('listShowStyleBody'),searchValues); 
				} 
				//end:高亮搜索结果
			</c:if>	 
		});	
		</script>
	</body>
</html>